# Copyright (c) 2016 by Michael Zahniser
#
# Endless Sky is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.  See the GNU General Public License for more details.

mission "Coalition: First Contact"
	landing
	name "Register with the Heliarchs"
	description "You have been told to travel to the <planet> to register with the rulers of Coalition space and petition them for permission to do business here."
	source
		government "Coalition"
	destination "Ring of Friendship"
	on offer
		"reputation: Coalition" += 10
		"reputation: Heliarch" += 10
		conversation
			`This planet seems to be inhabited by at least three different sentient species. First are giant beetles, about a meter tall, who scurry quickly toward your ship and swarm around it, gawking at you, as soon as you land. The second species, even more disturbing than the beetles, are giant spiders. And the third species are centaurs. Not just something vaguely resembling centaurs; they look like they could have stepped right off the page of a story book from ancient Earth.`
			`	One of the spiders walks up to you, stretching its legs to raise its face and many eyes to the level of your own face, and says something to you in a gloopy sort of burbling language that you don't understand. The beetles, meanwhile, are talking to each other in a different language, all clicks and chittering. And the centaur stands quietly at a distance and keeps glancing back toward the spaceport as if waiting for someone.`
			`	And eventually, someone does arrive: a beetle, a spider, and a centaur all wearing yellow armbands and some sort of electric box hanging on a chain around each of their necks. They walk up to you, and the centaur speaks. After a brief delay, the box around its neck says, "In the name of the Heliarchs, who drove out the oppressors, who maintain peace, we the human visitor greet."`
			choice
				`	"Thank you."`
					goto next
				`	"How do you know my language?"`
			`	The spider speaks, and the box around its neck translates. "Our nearest and most recent neighbor you are. The Heliarchs in their great wisdom, all things that come to pass in our region of space, they are aware of."`
			label next
			`	Speaking through its own translation box, the beetle says, "To the seat of the Heliarch government must you go. Once to the Heliarchs you have become known, in many ways to our society, contribute you may."`
			`	The centaur pulls out a map printed on a thin sheet of plastic. You recognize it as a star map of this region. Lines mark out three different territories, and where they meet are three star systems colored yellow. The centaur points to the southernmost of the three. "Where you must go, here it is," it says.`
			choice
				`	"Thank you. I will go there."`
					goto end
				`	"Can you tell me more about yourselves, first?"`
			`	The spider says, "The wise Heliarchs, all your questions they will answer."`
			label end
			`	Eventually the crowd disperses and allows you to visit the spaceport, although no one offers you any jobs or the opportunity to buy anything but basic commodities. Perhaps you need to register with the "Heliarchs" first.`
				accept
	on complete
		"reputation: Coalition" += 10
		"reputation: Heliarch" += 10
		set "known to the heliarchs"
		conversation
			`Your first view of the landing area confirms beyond a doubt that this is a Quarg ringworld, not just an imitation of one. The interior architecture is unmistakable. But no Quarg are present here, only the three species of the Coalition. Soon after you land, a delegation approaches your ship: again, one of each species, but these are wearing golden circlets around their heads. The circlets are not merely decorative, but seem to contain some electronics as well.`
			`	Again, the centaur speaks first. "To our territory, to welcome you we are glad," it says.`
			`	The beetle says, "With our people you may mingle. The beauty of our culture, you may experience."`
			`	The spider adds, "Our people and yours perhaps one day may trade. Perhaps one day the humans our great and free Coalition may join."`
			choice
				`	"Tell me more about your Coalition."`
				`	"Is this a Quarg ringworld? Where are the Quarg?"`
			`	The centaur says, "Like you, our three species once, by the Quarg were ruled. But with each other, connections we made. An alliance we formed, and the oppressors we drove away. For six thousand Earth years now, in prosperity and freedom from Quarg constraint and in friendship with each other we have lived."`
			choice
				`	"The Quarg don't seem that oppressive to me."`
					goto oppressive
				`	"How did you defeat the Quarg?"`
			`	The spider says, "Alone, no species all skills or all knowledge possesses. But when our abilities we combine, powerful we may become. That, the reason is, that the Quarg all species in isolation keep."`
				goto next
			label oppressive
			`	The spider says, "In separate boxes, they each species keep. And in subtle ways, your development and discoveries they limit. And on your technology, restrictions they place."`
			`	The beetle says, "Or, wrong are we? And the jump drive that brought you here, a gift from the Quarg it is? They its secret no longer hoard?" You tell it that the Quarg do indeed refuse to give jump drives to humans, and it says, "Then, prisoners indeed you are."`
			label next
			branch hai
				has "First Contact: Hai: offered"
			choice
				`	"I suppose you may be right about the Quarg."`
					goto end
				`	"Perhaps the Quarg will change their minds in the future."`
			`	The giant beetle considers you gravely. "Hope, we can only," it says.`
					goto end
			label hai
			choice
				`	"I suppose you may be right about the Quarg."`
					goto end
				`	"But, the Quarg do let the humans and the Hai make contact with each other."`
			`	This, apparently, is news to them. You explain to them who the Hai are, and that some humans have made contact with them and are living in their territory. "A second Coalition you are forming!" says the centaur, tapping its hooves on the floor in excitement. "Once again, foiled the Quarg are. A secret way for species to work together, they have overlooked. Great things, from this may come."`
			label end
			`	You talk with them for a while longer, and learn that the centaurs are called "Saryds," and are the oldest of the three species. The beetles are the "Kimek," and come next, and the spiders are called "Arachi," and were the last of the three to discover spaceflight.`
			`	They tell you that the best way to learn more about them is to visit their worlds, and to see for yourself how the three species live in friendship and equality. They also offer to give you jobs to do in their territory, so that you may become a "valuable contributor" to their society.`



mission "Coalition: Contributor"
	landing
	name "Return to the <planet>"
	description "Return to the <planet> to see if the Heliarchs will grant you a higher status in the Coalition now that you have been working among them for some time."
	to offer
		"coalition jobs" >= 30
	source
		government "Coalition"
	destination "Ring of Friendship"
	on offer
		conversation
			`A Heliarch agent contacts you soon after you land, and says, "In many useful ways, among us you have been working. The Heliarchs you should petition, and your rights and status among us they may elevate." The agent instructs you to return to the <planet> and petition the Heliarch rulers there.`
				accept
	on complete
		"reputation: Coalition" += 10
		"reputation: Heliarch" += 10
		event "coalition: shipyard and outfitters"
		conversation
			`Once again, when you exit your ship you are met by a member of each of the three Coalition species, wearing the golden circlets that mark them as Heliarchs. "Told we have been," says the Saryd, "that among us with great diligence and commitment, small tasks you have performed."`
			`	The Kimek says, "Those who in our society's prosperity have invested, with our society's technology may be trusted."`
			`	"But," says the Arach, "like all civilians, even citizens, to you our weapons and warships we still cannot sell."`
			choice
				`	"Thank you."`
					goto end
				`	"Why don't you allow civilians to purchase weapons or warships?"`
			`	"For the sake of peace it is," says the Saryd. "The Heliarch military, well trained to use weapons only for defense and only for justice, they are. And to place the needs of the Coalition over the ambitions of their own native species, each one committed is. No such discipline do civilians have."`
			label end
			`	Apparently nothing is for sale here, but they assure you that many Coalition worlds will now grant you access to their shipyards and outfitters.`



event "coalition: shipyard and outfitters"
	planet "Ablub's Invention"
		outfitter "Coalition Advanced"
	planet "Ahr"
		shipyard "Coalition Basics"
		shipyard "Arach"
		outfitter "Coalition Advanced"
	planet "Bank of Blugtad"
		shipyard "Coalition Basics"
		shipyard "Arach"
		outfitter "Coalition Advanced"
	planet "Belug's Plunge"
		outfitter "Coalition Advanced"
	planet "Blubipad's Workshop"
		outfitter "Coalition Basics"
	planet "Dwelling of Speloog"
		outfitter "Coalition Basics"
	planet "Hammer of Debrugt"
		shipyard "Coalition Basics"
		shipyard "Arach"
		outfitter "Coalition Advanced"
	planet "Market of Gupta"
		shipyard "Coalition Basics"
		shipyard "Arach"
		outfitter "Coalition Advanced"
	planet "Stronghold of Flugbu"
		outfitter "Coalition Advanced"
	planet "Ashy Reach"
		outfitter "Coalition Basics"
	planet "Blue Interior"
		shipyard "Coalition Basics"
		shipyard "Kimek"
		outfitter "Coalition Advanced"
	planet "Brass Second"
		outfitter "Coalition Basics"
	planet "Ki Patek Ka"
		shipyard "Coalition Basics"
		shipyard "Kimek"
		outfitter "Coalition Advanced"
	planet "Midway Emerald"
		shipyard "Coalition Basics"
		outfitter "Coalition Basics"
	planet "Remote Blue"
		shipyard "Kimek"
		outfitter "Coalition Advanced"
	planet "Rusty Second"
		shipyard "Coalition Basics"
		outfitter "Coalition Basics"
	planet "Sandy Two"
		outfitter "Coalition Basics"
	planet "Second Viridian"
		outfitter "Coalition Basics"
	planet "Bright Echo"
		shipyard "Coalition Basics"
		shipyard "Saryd"
		outfitter "Coalition Basics"
	planet "Chosen Nexus"
		shipyard "Coalition Basics"
		shipyard "Arach"
		shipyard "Kimek"
		shipyard "Saryd"
		outfitter "Coalition Advanced"
	planet "Far Garden"
		outfitter "Coalition Basics"
	planet "Far Home"
		shipyard "Coalition Basics"
		shipyard "Arach"
		shipyard "Kimek"
		shipyard "Saryd"
		outfitter "Coalition Advanced"
	planet "Saros"
		shipyard "Coalition Basics"
		shipyard "Saryd"
		outfitter "Coalition Advanced"
	planet "Warm Slope"
		outfitter "Coalition Basics"
